import App from './App'
import {
	api
} from './network/api.js'

import {
	util
} from './utils/util.js'
import Vuex from 'vuex'
import store from './store'

// #ifndef VUE3
import Vue from 'vue'
import uView from "uview-ui";
Vue.config.productionTip = false
Vue.use(uView);
Vue.prototype.$api = api;
Vue.prototype.$util = util;
Vue.prototype.$toast = util.toast;
Vue.prototype.$store = store;
Vue.prototype.$to = async (promise) => {
	return promise
		.then(data => {
			return [null, data];
		})
		.catch(err => {
			return [err];
		});
}
App.mpType = 'app'
const app = new Vue({
	...App,
	store
})
app.$mount()
export default app;
// #endif

// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
export function createApp() {
	const app = createSSRApp(App)
	return {
		app
	}
}
// #endif
